<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="/test/login" method="post">
    <table>
        <tr>
            <td>用户名</td>
            <td>
            <input type="text" name="username">
            </td>
        </tr>
        <tr>
            <td>密码</td>
            <td>
            <input type="password" name="password">
            </td>
        </tr>
        <tr>
            <td>
                <img id="cap" onclick="refresh()" src="/captcha" style="width: 100px">
            </td>
            <td><input type="text" name="code" placeholder="请输入验证码"></td>

        </tr>
        <tr>
            <td>
                <input type="submit" value="登录">
            </td>
        </tr>
    </table>
</form>
</body>
<script type="text/javascript">
    function refresh() {
        var cap = document.getElementById("cap");
        cap.src="/captcha?"+new Date();
    }
</script>
</html>